// pages/test-list/test-list.js
Page({
  data: {
    tests: [
      {
        type: 'mbti',
        title: 'MBTI 性格测试',
        desc: '了解你的性格类型',
        count: 93,
        time: 10
      },
      {
        type: 'sds',
        title: 'SDS 抑郁自评量表',
        desc: '评估抑郁状态',
        count: 20,
        time: 5
      },
      {
        type: 'sas',
        title: 'SAS 焦虑自评量表',
        desc: '评估焦虑状态',
        count: 20,
        time: 5
      },
      {
        type: 'baker',
        title: '贝克抑郁测试',
        desc: '评估抑郁程度',
        count: 21,
        time: 5
      }
    ]
  },
  goToDetail(e) {
    const type = e.currentTarget.dataset.type
    wx.navigateTo({
      url: `/pages/test-detail/test-detail?type=${type}`
    })
  },
  goToHistory() {
    wx.navigateTo({
      url: '/pages/test-history/test-history'
    })
  }
})